<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{$_LANG['注册']} {$conf.title2}</title>

<link href="{#WWW}View/hy_user/css/login.css" rel="stylesheet">
<link href="{#WWW}public/css/alert.css" rel="stylesheet">
<!--[if (gte IE 9)|!(IE)]><!-->
<script src="{#WWW}public/js/jquery.min.js"></script>
<!--<![endif]-->
<!--[if lte IE 8 ]>
<script src="{#WWW}public/js/jquery1.11.3.min.js"></script>
<![endif]-->
<script src="{#WWW}public/js/sweet-alert.min.js"></script>
<!--{hook t_user_add_header}-->
</head>
<body>
	<div class="main">
		<div class="login-form">
			<h1 style="padding-top:30px">{$_LANG['用户注册']}</h1>

			<form id="form">
				<!--{hook t_user_login_5}-->
				<label for="user" style="margin-top:0">{$_LANG['账户']}</label>
				<input type="text" name="user" class="text" value=""/>
				<label for="user" style="margin-top:0">{$_LANG['邮箱']}</label>
				<input type="text" name="email" class="text" value=""/>
				<label for="user" style="margin-top:0">{$_LANG['密码']}</label>
				<input type="password" name="pass1" value=""/>
				<label for="user" style="margin-top:0">{$_LANG['确认密码']}</label>
				<input type="password" name="pass2" value="" />
				<!--{hook t_user_login_6}-->
				<div class="submit">
					<input id="login" type="submit" value="{$_LANG['注 册']}" >
				</div>
				<!--{hook t_user_login_7}-->

				<p><a href="{php HYBBS_URL('user','login')}">{$_LANG['已有账号登录']}</a></p>
			</form>
		</div>

	</div>

<script>
$(function(){
    $('#form').submit(function() {return false;});
    $("#login").click(function(){
        var postdata = $('#form').serialize();
        <!--{hook t_user_add_js_1}-->
        $.post("{php HYBBS_URL('user','add')}", postdata,  function(e){
        	<!--{hook t_user_add_js_2}-->
            if(e.error){
                if(e.url !='' && e.url != 'NULL' && e.url != 'null')
                    window.location.href=e.url;
                else
                    window.location.href="{#WWW}";
            }else{
            	swal(e.error ? "{$_LANG['注册成功']}" : "{$_LANG['注册失败']}", e.info, e.error ? "success" : "error");
            }
            <!--{hook t_user_add_js_3}-->
        },'json');
        <!--{hook t_user_add_js_4}-->

    })

});
</script>
</body>
</html>
